package com.example.scaletest;


import android.widget.LinearLayout;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;

import java.util.List;

public class SetAdapter extends BaseQuickAdapter<ItemSetEntity, BaseViewHolder> {

    public SetAdapter(int layoutResId, List<ItemSetEntity> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, ItemSetEntity itemSetEntity) {

        LinearLayout ll_item = baseViewHolder.getView(R.id.ll_item);
        if (itemSetEntity.isChose()){
            ll_item.setBackgroundResource(R.drawable.btn_save_bg);
        }else {
            ll_item.setBackgroundResource(R.drawable.bg_menu_child);
        }

        baseViewHolder.setText(R.id.tv_name,itemSetEntity.getName()).setText(R.id.tv_value,itemSetEntity.getSubName());

    }
}
